/* 
 * File:   Dup.h
 * Author: Gab'z
 *
 * Created on 31 mai 2012, 14:47
 */

#ifndef DUP_H
#define	DUP_H

#include "../Operator.h"

namespace calculator {

    class Dup : public Operator {
        friend class CommandMap;
    public:
        std::string isExecutable() const;
        virtual Dup* clone() const;

        const Memento* createMemento() const throw (CommandException);
        void restoreFromMemento(const Memento* memento) const throw (MementoException);
    protected:
        Dup(const std::string name);
        virtual ~Dup();
    private:
        void eval(Stack* stack) const throw (CommandException);
        Dup(const Dup& orig);
    };
    
}

#endif	/* DUP_H */

